<?php
require_once ("src/db/connectdatabase.php");

function getInstallmentRates() {
	$con = new ConnectDB();
	$tbl = "installmentrate";
	$fn = array('bankname', 'bankid', 'banklogo', 'cata', 'catb', 'others', 'prepaymentcharge', 'processfee', 'dateupdate');
	$condetion = array('isuse' => true);
	$flike = array();
	return $con -> getvalueall($tbl, $fn, $condetion, $flike, 'dateupdate');
}

function getIntroLoan() {
	$con = new ConnectDB();
	$tbl = "loans";
	$fn = array('inforate', 'intro_rate_header');
	$condetion = array('loan_id' => 'vay_tra_gop');
	return $con -> getvalue($tbl, $fn, $condetion);
}

$arrperrate = getInstallmentRates();
$introloan = getIntroLoan();
?>
<script type="text/javascript">
    document.title = "Lãi suất cho vay mua nhà, ô tô và xe máy trả góp - Tài Chính Online";
</script>
<div class="text12" style="margin: auto; width: 970px; height: 11px; margin-top: 11px; color: #0a8bd9;">
    <u><a href="http://taichinhonline.vn" class="text12" style="color: #0080d6;">Trang chủ</a></u>&gt; <u><a href="<?php echo($host) ?>cho-vay-tra-gop.html" class="text12" style="color: #0080d6;">Vay trả góp</a></u>&gt; Lãi suất cho vay</span>
</div>
<div style="clear: both; height: 5px;"></div>
<div class="intrl_txt">
    <table>
        <tbody>
            <tr>
                <td width="72%">
                  <div style="clear:both"></div>
                    <div>
                    <?php 
                        if(count($introloan) == 1) {
                        ?>
                        <div class="text11" style="color: #4c4c4c; width: 950px; margin-left: 8px; margin-top: 10px;"><?php echo($introloan[0][1]) ?></div>
                        <?php
                        }
                        ?>
                    </div>
                    <div style="clear:both"></div>
                </td>
                <td width="28%">&nbsp;</td>
            </tr>
        </tbody>
    </table>
    <div style="clear:both;"></div>
    <span style="margin-left: 10px;"> Cập nhật cuối cùng ngày: <?php echo date("d/m/Y",time()); ?></span>
    <div style="clear:both;"></div>
    <div class="text11" style="color: #4c4c4c; width: 950px; margin-left: 8px; margin-top: 10px;">
        <!-- co the chen noi dung o day -->
		<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#d5cfb1">
			<tbody>
				<tr bgcolor="#88a943">
					<td width="104" rowspan="2" align="center" bgcolor="#88a943" class="tblwt_txt"><b>Ngân hàng/Lãi suất</b></td>
					<td height="25" colspan="5" align="center" bgcolor="#88a943" class="tblwt_txt"><b>Lãi suất</b></td>
				</tr>
				<tr bgcolor="#88a943">
					<td width="210" height="30" align="center" style="font-weight: bold; color: #FFFFFF; clear: both"><b>Danh sách A</b></td>
					<td width="210" height="30" align="center" bgcolor="#88a943" style="font-weight: bold; color: #FFFFFF; clear: both"><b>Danh sách B</b></td>
					<td width="310" align="center" style="font-weight: bold; color: #FFFFFF; clear: both"><b>Khác</b></td>
					<td width="52" align="center" style="font-weight: bold; color: #FFFFFF; clear: both">Phí tất toán</td>
                    <td width="45" align="center" style="font-weight: bold; color: #FFFFFF; clear: both">Phí trả chậm</td>
				</tr>
                
                <?php
				foreach($arrperrate as $entry) {
				?>
				<tr bgcolor="#EFEEEE">
					<td height="25" align="center" bgcolor="#FFFFFF" class="tbl_txt"><b><a href="" style="color: #0033FF;"><img width="100px" src="<?php echo($host) ?><?php echo($entry[2]) ?>" title="<?php echo($entry[0]) ?> (<?php echo($entry[1]) ?>)" /><br><?php echo($entry[0]) ?> (<?php echo($entry[1]) ?>)</a></b></td>
					<td height="17" align="center" bgcolor="#FFFFFF" class="tbl_txt"><?php echo($entry[3]) ?></td>
					<td align="center" bgcolor="#FFFFFF" class="tbl_txt"><?php echo($entry[4]) ?></td>
					<td align="center" bgcolor="#FFFFFF" class="tbl_txt"><?php echo($entry[5]) ?></td>
					<td align="center" bgcolor="#FFFFFF" class="tbl_txt"><?php echo($entry[6]) ?></td>
					<td align="center" valign="middle" bgcolor="#FFFFFF" class="tbl_txt"><?php echo($entry[7]) ?></td>
				</tr>
                <?php
				}
				?>
			</tbody>
		</table>
		<div style="clear:both"></div>
        <div>
		<?php 
            if(count($introloan) == 1) {
            ?>
            <div class="text11" style="color: #4c4c4c; width: 950px; margin-left: 8px; margin-top: 10px;"><?php echo($introloan[0][0]) ?></div>
            <?php
            }
            ?>
        </div>
    </div>
</div>